<template>
	<view class="container">
		<view v-for="(item,index) in list">
			<view class="order-list-item">
				<view class="item-left">
					<view class=" left-top">
						<view class="carlisence">{{item.carLicense}}</view>
						<view class="order-time">{{item.payTime}}</view>
					</view>
					<view class="left-bottom">
						<view class="parkinglot-name">{{item.parkingLotName}}</view>
					</view>
				</view>
				<view class="item-right">
					<view class="right-top">
						<view class="price-box">
							<view class="price-affix">实付</view>
							<view class="price-symbol">￥</view>
							<view class="real-price">{{item.payableAmount}}</view>
						</view>
						<view class="parking-time">{{item.parkingTime}}</view>
					</view>
					<view class='right-bottom' @click="toOrderDetail(index)">订单详情</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getMyRecord
	} from "@/api/api"
	export default {
		data() {
			return {
				list: [],
			};
		},
		onLoad() {
			this.getListFun()
		},
		methods: {
			async getListFun() {
				const result = await getMyRecord({
					openId: 'o-z5d5PEJnmaTim1CA6ezbBcVYVM',
					pageNo: 1,
					pageSize: -1
				});
				this.list = result.data.records
			},
			toOrderDetail(index) {
				uni.navigateTo({
					url: `/pages/recordDetail/recordDetail?index=${index}`
				})
			}
		}
	}
</script>

<style lang="less">
	.container {
		padding: 30rpx;
	}

	.order-list-item {
		display: flex;
		justify-content: space-between;
		padding: 24rpx 0 8rpx 0;
		height: 220rpx;
		box-sizing: border-box;
		border-bottom: 2rpx solid #F3F4F5;
	}

	.item-left {
		display: flex;
		justify-content: space-between;
		flex-direction: column;
	}

	.carlisence {
		font-size: 42rpx;
		font-weight: 500;
		color: #242A37;
		margin-bottom: 10rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.parking-time,
	.parkinglot-name,
	.order-time {
		font-size: 32rpx;
		font-weight: 400;
		color: #A4A8B0;
	}

	.item-left .left-bottom {
		font-size: 24rpx;
		font-weight: 400;
		color: #A4A8B0;
		/* line-height: 34rpx; */
	}

	.item-left .left-bottom .parking-item {
		margin-bottom: 16rpx;
	}


	.item-right {
		display: flex;
		flex-direction: column;
		align-items: flex-end;
		justify-content: space-between;
	}

	.price-box {
		display: flex;
		align-items: baseline;
		justify-content: center;
		margin-bottom: 10rpx;
	}

	.item-right .right-top {
		display: flex;
		flex-direction: column;
		align-items: flex-end;
	}

	.item-right .right-top .price-affix {
		margin-right: 12rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #A4A8B0;
	}

	.item-right .right-top .price-symbol {
		font-size: 26rpx;
		color: #242A37;
	}

	.item-right .right-top .real-price {
		font-size: 42rpx;
		font-weight: 500;
	}

	.right-bottom {
		height: 34rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #A4A8B0;
		line-height: 34rpx;
		background: url(../../static/images/mine_right_arrow.png) no-repeat 98% center;
		background-size: 28rpx;
		padding-right: 40rpx;
	}
</style>
